package com.gao.shiro.shiro;

import com.gao.modules.user.pojo.SysUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description TODO  此类主要是针对shiro登录  与SysUser实体类大体相同  剔除一些敏感信息，例如：用户密码此类不包含
 * @Author anshenghui
 * @Date 2020/1/16 14:19
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class UserModel {

    //用户id 对应主键id  与实体类SysUserentity实体类Id对应
    private String id;

    //用户名
    private String username;

    //角色编码
    private String orgCode;

    //手机号
    private String phone;

    //邮箱
    private String email;

    //性别
    private Integer sex;

    //无参构造
    public UserModel() {

    }

    //有参构造器，将SysUserEntity转成UserModel
    public UserModel(SysUser sysUserEntity) {
        this.id = sysUserEntity.getId();
        this.username = sysUserEntity.getUserName();
        this.phone = sysUserEntity.getPhone();
        this.email = sysUserEntity.getEmail();
    }
}
